/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn;

import cn.webrx.config.SpringConfig;

import cn.webrx.pojo.Db;
import cn.webrx.pojo.Log;
import cn.webrx.pojo.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * <p>Project: spring2021 - Demo
 * <p>Powered by webrx On 2021-11-02 16:25:54
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfig.class)
//@ContextConfiguration(locations = "classpath:beans.xml")
public class Demo {
    @Autowired
    private ApplicationContext ctx;

    @Autowired
    private Db db;

    @Autowired
    private User user;

    @Autowired
    private Log log;

    @Test
    public void t2(){
        db.save();

        db.delete();

        user.show();

        //log.connect();
        //log.close();
    }


    @Test
    public void t1(){
        for(String s : ctx.getBeanDefinitionNames()){
            System.out.println(s);
        }
    }
}
